package com.hetao.xx.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.hetao.xx.orm.NpcVo;
import com.hetao.xx.orm.UserVo;

public class CommonUtil {


    public static NpcVo CloneNpcVo(NpcVo npcVo) {
        String tmp = JSONObject.toJSONString(npcVo);
        return JSONObject.parseObject(tmp, NpcVo.class);
    }

    public static UserVo CloneUserVo(UserVo npcVo) {
        String tmp = JSONObject.toJSONString(npcVo);
        return JSONObject.parseObject(tmp, new TypeReference<UserVo>(){});
    }
}
